﻿<Window x:Class="P2.Cuberry.Modules.Framework.ModuleManager.XFieldValidationDetailsView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:cal="http://www.codeplex.com/prism"
    xmlns:local="clr-namespace:P2.Cuberry.Modules.Framework.ModuleManager"
    
    Height="665" Width="487"
        
        Icon="/P2.Cuberry;component/Images/CuberryIcon32.ico"
        Title="Peacequare Cuberry"              
        Background="{DynamicResource P2BackgroundBrush}" 
        Loaded="Window_Loaded"
        >

    <Window.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="/P2.Cuberry.Framework.Layout;component/Styles/Styles.xaml"/>
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </Window.Resources>

    <Grid>
        <Grid.Resources>
            <Image x:Key="SaveAndNewIcon" Height="16" Width="16" Source="/P2.Cuberry.Modules.Framework.ModuleManager;component/Images/SaveAndNew.ico" />
            <Image x:Key="FindIcon" Height="16" Width="16" Source="/P2.Cuberry.Modules.Framework.ModuleManager;component/Images/find16.gif" />
        </Grid.Resources>

        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*"/>
        </Grid.ColumnDefinitions>

        <Grid.RowDefinitions>
            <RowDefinition Height="40" />
            <RowDefinition Height="35" />
            <RowDefinition Height="*"/>
            <RowDefinition Height="35" />
        </Grid.RowDefinitions>

        <!-- Row 0 Start -->

        <Label Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="3" Content="{Translate DialogHeaderFieldValidation}" Style="{StaticResource P2DetailViewHeaderTextStyle}" />

        <Separator Margin="0,0,0,0" Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="3" VerticalAlignment="Bottom" Height="0"/>
        <!-- Row 0 End -->

        <!-- Row 1: Menu Start -->
        <Border  Grid.Row="1" Grid.Column="0"  Style="{StaticResource P2MenuBorderStyle}">
            <Menu Grid.Row="1" x:Name="menuMain" Style="{StaticResource P2MenuStyle}">
                <MenuItem x:Name="SaveBtn" InputGestureText="Ctrl+S" Header="{Translate SaveAndCloseBtn}" Command="{Binding XFieldValidationSaveCommand }" Style="{StaticResource P2MenuItemStyleSaveAndClose}" />
                <MenuItem x:Name="SaveAndNewBtn" InputGestureText="Ctrl+S" Header="{Translate SaveAndNewBtn}" Command="{Binding XFieldValidationSaveAndNewCommand}" Icon="{StaticResource SaveAndNewIcon}" Style="{StaticResource P2MenuItemStyle}" />               
            </Menu>
        </Border>
        <!-- Row 1 End -->
        <!-- Row 2: All Fields -->
        <Border  Grid.Row="2" Grid.Column="0"  Style="{StaticResource P2ContentBorderStyle}">
            <Grid Width="440" Height="502">
                <Label HorizontalAlignment="Left" Margin="5,5,0,0" Name="EntityNameL" Width="120" Content="{Translate EntityNameL}" Height="28" VerticalAlignment="Top"></Label>
                <TextBox  Margin="5,28,0,0" Name="EntityName" Width="251" 
                          Text="{Binding FieldEnitytName, ValidatesOnExceptions=True, NotifyOnValidationError=True, ValidatesOnDataErrors=True}" 
                          Validation.ErrorTemplate="{StaticResource ErrorTemplate}"  HorizontalAlignment="Left" 
                          Style="{StaticResource P2TextBoxStyle}" Height="23" VerticalAlignment="Top" MaxLength="50" />

                <Label HorizontalAlignment="Left" Margin="6,0,0,75" Name="ValidationTypeL" Width="120" Height="28" VerticalAlignment="Bottom" Content="ValidationTypeL"></Label>
                <TextBox  Margin="5,0,0,57" Name="ValidationType" Height="23" Width="251" 
                          Text="{Binding Path=ValidationType, ValidatesOnExceptions=True, NotifyOnValidationError=True, ValidatesOnDataErrors=True}" 
                          Validation.ErrorTemplate="{StaticResource ErrorTemplate}"  HorizontalAlignment="Left"  VerticalAlignment="Bottom" 
                          Style="{StaticResource P2TextBoxStyle}" MaxLength="10" />

                <Label  Height="28" HorizontalAlignment="Left" Margin="6,102,0,0" Name="ControlTypeL" VerticalAlignment="Top" Width="120" Content="ControlTypeL" />
                <TextBox Margin="6,123,183,356" Name="ControlType" 
                         Text="{Binding Path=ControlType , ValidatesOnExceptions=True, NotifyOnValidationError=True, ValidatesOnDataErrors=True}" 
                         Validation.ErrorTemplate="{StaticResource ErrorTemplate}" Style="{StaticResource P2TextBoxStyle}" Width="251" Height="23" MaxLength="50" />
                
                <Label Content="FieldNameL" Height="23" HorizontalAlignment="Left" Margin="6,57,0,0" Name="FieldNameL" VerticalAlignment="Top" Width="93" />
                <TextBox HorizontalAlignment="Left" Margin="6,78,0,0" Name="FieldName" VerticalAlignment="Top" Width="251" 
                         Text="{Binding Path=FieldName, ValidatesOnExceptions=True, NotifyOnValidationError=True, ValidatesOnDataErrors=True}"
                         Style="{StaticResource P2TextBoxStyle}" MaxLength="50" />
                
                <Label Content="ControlContentTypeL" Height="28" HorizontalAlignment="Left" Margin="6,151,0,0" Name="ControlContentTypeL" VerticalAlignment="Top" />
                <TextBox Height="23" HorizontalAlignment="Left" Margin="6,172,0,0" Name="ControlContentType" VerticalAlignment="Top" Width="251" 
                         Text="{Binding Path=ControlContentType, ValidatesOnExceptions=True, NotifyOnValidationError=True, ValidatesOnDataErrors=True}"
                         Style="{StaticResource P2TextBoxStyle}" MaxLength="50" />
                
                <Label Content="RegExL" Height="28" HorizontalAlignment="Left" Margin="6,201,0,0" Name="RegExL" VerticalAlignment="Top" />
                <TextBox Height="23" HorizontalAlignment="Left" Margin="6,224,0,0" Name="RegEx" VerticalAlignment="Top" Width="251" 
                         Text="{Binding Path=RegEx, ValidatesOnExceptions=True, NotifyOnValidationError=True, ValidatesOnDataErrors=True}"
                         Style="{StaticResource P2TextBoxStyle}" MaxLength="150" />
                
                <Label Content="MinDateTimeL" Height="28" HorizontalAlignment="Left" Margin="6,245,0,0" Name="MinDateTimeL" VerticalAlignment="Top" />
                <DatePicker Height="25" HorizontalAlignment="Left" Margin="6,268,0,0" Name="MinDateTime" VerticalAlignment="Top" Width="115" 
                            SelectedDate="{Binding Path=MinDateTime, ValidatesOnExceptions=True, NotifyOnValidationError=True, ValidatesOnDataErrors=True}"/>
                
                <Label Content="MaxDateTimeL" Height="28" HorizontalAlignment="Left" Margin="135,245,0,0" Name="MaxDateTimeL" VerticalAlignment="Top" />
                <DatePicker Height="25" HorizontalAlignment="Left" Margin="135,268,0,0" Name="MaxDateTime" VerticalAlignment="Top" Width="115" 
                             SelectedDate="{Binding Path=MaxDateTime, ValidatesOnExceptions=True, NotifyOnValidationError=True, ValidatesOnDataErrors=True}"/>
                
                <Label Content="MinIntL" Height="28" HorizontalAlignment="Left" Margin="6,299,0,0" Name="MinIntL" VerticalAlignment="Top" />
                <TextBox Height="23" HorizontalAlignment="Left" Margin="6,323,0,0" Name="MinInt" VerticalAlignment="Top" Width="116" 
                         Text="{Binding Path=MinInt, ValidatesOnExceptions=True, NotifyOnValidationError=True, ValidatesOnDataErrors=True}"
                         Style="{StaticResource P2TextBoxStyle}" />
                
                <Label Content="MaxIntL" Height="28" HorizontalAlignment="Left" Margin="135,299,0,0" Name="MaxIntL" VerticalAlignment="Top" />
                <TextBox Height="23" HorizontalAlignment="Left" Margin="135,323,0,0" Name="MaxInt" VerticalAlignment="Top" Width="120" 
                         Text="{Binding Path=MaxInt, ValidatesOnExceptions=True, NotifyOnValidationError=True, ValidatesOnDataErrors=True}"
                         Style="{StaticResource P2TextBoxStyle}" />
                
                <Label Content="MinTextL" Height="28" HorizontalAlignment="Left" Margin="6,352,0,0" Name="MinTextL" VerticalAlignment="Top" />
                <TextBox Height="23" HorizontalAlignment="Left" Margin="5,375,0,0" Name="MinText" VerticalAlignment="Top" Width="120" 
                         Text="{Binding Path=MinText, ValidatesOnExceptions=True, NotifyOnValidationError=True, ValidatesOnDataErrors=True}"
                         Style="{StaticResource P2TextBoxStyle}" />
                
                <Label Content="MaxTextL" Height="28" HorizontalAlignment="Left" Margin="135,352,0,0" Name="MaxTextL" VerticalAlignment="Top" />
                <TextBox Height="23" HorizontalAlignment="Left" Margin="135,375,0,0" Name="MaxText" VerticalAlignment="Top" Width="120" 
                         Text="{Binding Path=MaxText, ValidatesOnExceptions=True, NotifyOnValidationError=True, ValidatesOnDataErrors=True}"
                         Style="{StaticResource P2TextBoxStyle}" />
            </Grid>
        </Border>

    </Grid>
</Window>
